{% extends 'adminapp/base.html' %}
{% load static %}


{% block container %}
    <div class="products_list">
        <a class="new_product btn btn-default"
           href={% url 'new_admin:category_product_create' category.pk %}>новый продукт</a>

        {% for object in object_list %}
            <div class="product_record {% if not object.is_active %}not_active{% endif %}">
                <img src="/media/{{ object.image|default:'products_images/default.jpg' }}" alt="{{ object.name }}">
                <div class="product_name">
                    {{ object.name|title }}
                </div>
                <div class="product_actions">
                    <button>
                        <a href={% url 'new_admin:product_view' pk=object.pk %}>подробнее</a>
                    </button>
                    <button>
                        <a href={#% url 'myadmin:product_update' object.pk %#}>редактировать</a>
                    </button>
                    <button>
                        <a href={#% url 'myadmin:product_delete' object.pk %#}>удалить</a>
                    </button>
                </div>
                <div class="summary">
                    <b>цена</b>
                    <p>{{ object.price }} руб</p>
                    <b>количество</b>
                    <p>{{ object.quantity }}</p>
                </div>
                <div class="product_desc">
                    {{ object.short_desc|capfirst }}
                </div>
            </div>
        {% endfor %}
    </div>
{% endblock %}